<!--
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>表单</title>
</head>
<body>
<table>
    <tr>
        <td class="td1">姓名</td><td><input type="text" id="username"></td>
        <td class="td1">Email</td><td><input type="text" id="Email"></td>
        <td class="td1">密码</td><td><input type="password" id="password"></td>

    </tr>
</table>
</body>
</html>-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <script type="text/javascript">
        function validate_email(field,alerttxt)
        {
            with (field)
            {
                apos=value.indexOf("@")
                dotpos=value.lastIndexOf(".")
                if (apos<1||dotpos-apos<2)
                {alert(alerttxt);return false}
                else {return true}
            }
        }

        function validate_form(thisform)
        {
            with (thisform)
            {
                if (validate_email(email,"Not a valid e-mail address!")==false)
                {email.focus();return false}
            }
        }
    </script>
</head>

<body>
<form action="submitpage.htm"onsubmit="return validate_form(this);" method="post">
    Email: <input type="text" name="email" size="30">
    <input type="submit" value="Submit">
</form>
</body>
</html>